.TH clipf 1 
.SH NAME
clipf \- Personal finance manager with command line interface
.SH SYNOPSYS
.B clipf
[<conf_dir>]
.SH DESCRIPTION
Simple personal finance manager, allow to track Your incomes/expences
by accounts and hierarchical categories. Store all data in flat text
files.
.SH ARGUMENTS
.TP
<conf_dir>
Directory with configuration file and data files. Default to
~/.clipf/. If there is no such directory found at program startup, it
would be created and populated by default configuration and empty data
files.
.SH DEFINITIONS
.B account
- describe independent money storage, for which You want to track
remains and turnover.
.P
.B item
- describe categories of Your incomes/expences. Can be nested as
files/directories in file system.
.P
.B item code
- it is segmented unique identifier of item/item group. Period "."
in item code define nesting levels. Period at the end of item code
describe, that this item is group (have subling items).
.P
.B operation
- define single money transaction (income or expense).
.P
.B tag
- arbitrary string, used for additional classification of operations.
Have the same nesting rules as items.
Any number of tags can be added to each operation. It may be good idea
to store available tags in item list.
.SH USAGE
Type
.B help
to see available commands. Type
.B help <command>
to see online help about particular <command>.
.P
For most reporting commands, output can be piped to external shell command the
same way, as shell do.
.SH COMMANDS CONCERNING ITEMS
.TP
prod add [\-d] <item_code> <item_name>
Add new item. Type <item_name> in quotes, if it contain spaces.
.RS
.TP
.B \-d 
- define this item as income (default to expence).
.RE
.TP
prod rm <item_code_prefix>
Remove all items, which code starts with <item_code_prefix>. This
don't affect the operations list.
.TP
prod ls [<item_code>]
Show one level of item list - direct sublings of <item_code>. Default
to root level.
.TP
prod mv <old_item_code_prefix> <new_item_code_prefix>
Update all item codes, which starts with <old_item_code_prefix>,
replacing it to <new_item_code_prefix>. Item codes in operation list 
would be updated as well.
.SH COMMANDS CONCERNING OPERATIONS
.TP
op add [\-d <date>] [\-a <account>] [-t <tag>] <item_code> <amount> [<note>]
Add new operation
.RS
.TP
.B \-d <date>
- override default operation date to <date>.
.TP
.B \-a <account>
- override defaut operation account to <account>
.TP
.B \-t <tag>
- label operation with <tag>. Any number of -t options can be used to
add several tags to operation.
.RE
.TP
op ls [-t <tag_prefix>] [<item_code_prefix>]
Show list of operations in current reporting period. If
<item_code_prefix> specified, list would be limited by the operations,
which item code starts with <item_code_prefix>. If '-t <tag_prefix>'
option specified, limit output with operations, labelled with tag,
starts with <tag_prefix>
.SH COMMANDS CONCERNING REPORTING
Reporting period is always between <date_from> and <date_to> global
options, which You set by
.B set
command.
.TP
rep prod [-t <tag_prefix>] [-a <account>] [<item_code>]
Show turnover report for items (item groups), which are direct subling
of <item_code> (default to root). Turnover for item group is summ of
turnovers of all their nested items/groups. 
.RS
.TP
.B -t <tag_prefix>
take into account only operations, labelled with tag, starts with <tag_prefix>
.TP
.B -a <account>
take into account only operations by <account> account.
.RE
.TP
rep acc
Show remains and turnovers for all accounts.
.SH OTHER COMMANDS
.TP
set <option> <value>
Set global option <option> value to <value>. For date options,
base format is Y-M-D. Leading 0 can be ommited. For the current
year, year part can be ommited. For current month, year and month
parts can be ommited.
Available options:
.RS
.TP 
.B date
- default date for new operations. Can be overriden by \-d option of
"op add".
.TP 
.B date_from
.TP
.B date_to
- reporting period for "op ls" and all "rep" subcommands.
.TP
.B acc
- default account for new operations. Can be overriden by \-a option
of "op add".
.TP
.B max_lines
- if number of lines in report output exceed this value, then "less"
would be used to show report output.
.RE
.TP
show [<option>]
Show current values of all global options or specified <option>.
.TP
calc <expression>
Embedded calculator. Evaluate numeric expression and print the result.
.SH ALIASES
Aliases is the simple way to make shortcuts for frequently used
commands. Alias can be defined by the pair of strings:
<command_line_prefix> and <prefix_substitution_string>. If command
line starts with any of the defined aliases <command_line_prefix>,
this prefix would be substituted with corresponding
<prefix_substitution_string>. Examples can be found in system
configuration file (see 
.B FILES
).
.SH EXAMPLES
.TP
set date_from 2008-04-01
- set reporting start period to 2008-04-01.
.TP
r prod
- show turnover report by top level items.
.TP
op ls | grep foo | less
pipe report output to shell command.
.TP
op ls | cat - >somefile.txt
save report output to file
.SH FILES
All configuration files have the same format - plain python code, that
would be executed during clipf startup, in the context of main module.
More specific configuration file can overwrite settings from more
general one.
.TP
.I /etc/clipf.conf
system-wide configuration file
.TP
.I ~/.clipf.conf
user-specific configuration
.TP
.I <config_path>/clipf.conf
configuration-specific settings.
.TP
.I ~/.clipf/
Default configuration directory. Contain
.I clipf.conf
configuration file, and
.I db/
subdirectory with data files.
.SH AUTHOR
Denis Galtsev <galtsevdv@gmail.com>
.SH SEE ALSO
Program site at: http://code.google.com/p/clipf/
